package com.hilaver.dzmis.dao;

import java.util.List;

import org.hibernate.Query;

import com.hilaver.dzmis.basicinfo.BiAccessoryButton;



public class BiAccessoryButtonDAO extends BaseHibernateDAO {
	public List<Integer> getMaxReferenceIndex(String ctMaterialType, String ctShape, Integer holeQuantity, Integer measure) throws Exception{
		String hql = "select max(referenceIndex) from " + BiAccessoryButton.class.getName() + " where ctMaterialType = ? and ctShape = ? and holeQuantity = ? and measure = ?";
		try {
			Query queryObject = getSession().createQuery(hql);
			queryObject.setParameter(0, ctMaterialType);
			queryObject.setParameter(1, ctShape);
			queryObject.setParameter(2, holeQuantity);
			queryObject.setParameter(3, measure);
			return queryObject.list();
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
	}
}
